package com.wyh6635.rate.redis;

import redis.clients.jedis.Jedis;

/**
 * Created by wangyanhui on 2016/11/29.
 */
public class RedisCountDemo {

    public static void main(String[] args) {
//        Jedis jedis = new Jedis("172.30.0.180", 6380);
//        jedis.del("test.key");

        for (int i = 0; i < 20; i++) {
            Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    Jedis jedis = new Jedis("172.30.0.180", 6380);

                    System.out.println("current Thread:" + Thread.currentThread().getName() + ":" + jedis.incr("test.key"));
                    jedis.close();
                }
            });

            t.start();
        }
    }


}
